﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Ext.Net;

namespace EGuayas.Web.Aspx.add
{
    public partial class pgForm : pgBase
    {
        protected void Page_Load(object sender, EventArgs e)
        {


            try
            {
                /*
                 * 
                 <ext:Panel 
                    ID="pnlDinamic" 
                    runat="server" 
                    Frame="true" 
                    Title="Label Top Align" 
                    Width="400"
                    Layout="FormLayout">
                    <Items>
                        <ext:TextField ID="TextField1" runat="server" FieldLabel="Label" LabelAlign="Top" />
                        <ext:TextField ID="TextField2" runat="server" FieldLabel="Label" LabelAlign="Top" />
                    </Items>
                </ext:Panel>
                 */
                // Viewport
                Viewport viewport = new Viewport
                {
                    Layout = "BorderLayout",
                
                    Items = 
                    { 
               
                        new Ext.Net.Panel 
                        {
                                     
                            Title = "Formulario CodeBehind",
                            BodyBorder = 0,
                            Region = Region.Center,
                            BodyStyle = "padding:6px;",
                            Icon = Icon.FolderWrench,
                            Items=
                            {
                         
                                    new TextField  { FieldLabel="Text1"},
                                    new TextField  { FieldLabel="Text1"},
                                    new ComboBox   { FieldLabel="Cbx1"},
                    
                            }
                   
                        }
                    }
                };

                // Add Viewport to Page
                this.Controls.Add(viewport);

                // Build all the Panels which will fill the Table Cells.
                Ext.Net.Panel panel1 = new Ext.Net.Panel();
                panel1.Title = "Lots of Spanning";
                panel1.BodyPadding = 15;
                panel1.Height = 320;
                panel1.Html = "<p>Row spanning.</p><br /><p>Row spanning.</p><br /><p>Row spanning.</p><br /><p>Row spanning.</p><br /><p>Row spanning.</p><br /><p>Row spanning.</p>";

                Ext.Net.Panel panel2 = new Ext.Net.Panel();
                panel2.Title = "Basic Table Cell";
                panel2.BodyStyle = "padding:15px;";
                panel2.Height = 105;
                panel2.Html = "<p>Basic panel in a table cell.</p>";

                Ext.Net.Panel panel3 = new Ext.Net.Panel();
                panel3.Header = false;
                panel3.BodyStyle = "padding:15px;";
                panel3.Height = 105;
                panel3.Html = "<p>Plain panel</p>";

                panel1.RowSpan = 3;
           
                Ext.Net.Panel pnlTableLayout = new Ext.Net.Panel();
                pnlTableLayout.ID = "pnlTableLayout";
                pnlTableLayout.Region = Region.Center;
                pnlTableLayout.Title = "Table Layout";
                pnlTableLayout.BodyPadding = 15;
                pnlTableLayout.Border = false;
                pnlTableLayout.Layout = LayoutType.Table.ToString();

                TableLayoutConfig tlc = new TableLayoutConfig()
                {
                    Columns = 4
                };
                pnlTableLayout.LayoutConfig.Add(tlc);

                pnlTableLayout.Items.Add(panel1);
                pnlTableLayout.Items.Add(panel2);
                pnlTableLayout.Items.Add(panel3);
          

                Viewport viewPort1 = new Viewport();
                viewPort1.Layout = "BorderLayout";
                viewPort1.Items.Add(pnlTableLayout);

                this.PlaceHolder1.Controls.Add(viewPort1);
            }
            catch (Exception ex)
            {
                RegistrarLog(ex);
            }

        }
    }
}